package web.entitys;

/**
 * created by yb
 * on 2017/8/17.
 **/
public class JSONResponse {
    private int status;
    private String desc;
    private Object data;
    public static JSONResponse sucess(Object data){
        JSONResponse response = new JSONResponse();
        response.setStatus( 1 );
        response.setData( data );
        return response;
    }
    public static JSONResponse seeor(String desc){
        JSONResponse response = new JSONResponse();
        response.setStatus( 0 );
        response.setDesc( desc );
        return response;
    }

    //region set get toString
    public int getStatus() {
        return status;
    }

    public void setStatus( int status ) {
        this.status = status;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc( String desc ) {
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "JSONResponse{" +
                "status=" + status +
                ", desc='" + desc + '\'' +
                ", data=" + data +
                '}';
    }

    public Object getData() {
        return data;
    }

    public void setData( Object data ) {
        this.data = data;
    }
    //endregion
}
